package businessLogic;

import businessEntities.QueryResultContainer;
import businessEntities.TreeModelWrapper;
import dataAccess.DALFileImporter;
import java.io.File;

public class BLFileImporter {

    /**
     * BL forward request to import data from <code>inputFile</code> formatted as CSV.
     * @return QueryResultContainer with the result or null if any problem occurred.
     */
    public QueryResultContainer importFromCSV(File inputFile) {

        DALFileImporter importer = new DALFileImporter();
        return importer.importFromCSV(inputFile);
    }

    /**
     * BL forward request to import data from <code>inputFile</code> formatted as XML.
     * @return QueryResultContainer with the result or null if any problem occurred.
     */
    public QueryResultContainer importFromXML(File inputFile) {
        DALFileImporter importer = new DALFileImporter();
        return importer.importFromXML(inputFile);
    }
    
    public TreeModelWrapper importTreeFromXML(File inputFile) {
        DALFileImporter importer = new DALFileImporter();
        return importer.importTreeFromXML(inputFile);
    }
}
